home *** CD-ROM | disk | FTP | other *** search
/ Columbia Kermit / kermit.zip / newsgroups / misc.20010306-20010921 / 000246_fdc@watsun.cc.columbia.edu_Thu Jul 5 17:43:36 EDT 2001.msg < prev    next >
Text File  |  2020-01-01  |  5KB  |  127 lines

  1. Article: 12571 of comp.protocols.kermit.misc
  2. Path: newsmaster.cc.columbia.edu!watsun.cc.columbia.edu!fdc
  3. From: fdc@watsun.cc.columbia.edu (Frank da Cruz)
  4. Newsgroups: comp.protocols.kermit.misc
  5. Subject: Re: Any way to alter Kermit "quit" so I don't have to "kill?"
  6. Date: 5 Jul 2001 21:43:52 GMT
  7. Organization: Columbia University
  8. Lines: 110
  9. Message-ID: <9i2n2o$dgn$1@newsmaster.cc.columbia.edu>
  10. References: <h_417.5247$oa1.534611@newsread1.prod.itd.earthlink.net>
  11. NNTP-Posting-Host: watsun.cc.columbia.edu
  12. X-Trace: newsmaster.cc.columbia.edu 994369432 13847 128.59.39.2 (5 Jul 2001 21:43:52 GMT)
  13. X-Complaints-To: postmaster@columbia.edu
  14. NNTP-Posting-Date: 5 Jul 2001 21:43:52 GMT
  15. Xref: newsmaster.cc.columbia.edu comp.protocols.kermit.misc:12571
  16.  
  17. In article <h_417.5247$oa1.534611@newsread1.prod.itd.earthlink.net>,
  18. Keith Doyle <keithuse@synco_pator.com> wrote:
  19. : I've been using a dialing program under Linux that will connect
  20. : to a shell account and do a bunch of intelligent stuff including
  21. : transfer files.  I had been using Zmodem via lrz/lsz with success 
  22. : for a long time, but I'm finding it's just not working anymore, 
  23. : due to the fact that I can only connect to the target machine now 
  24. : via some kind of POP service that uses telnet and is none too
  25. : transparent.  It may even be 7 bit, it's not clear, and I have
  26. : no control over it.
  27. : At any rate, I found that I could manually use kermit to perform
  28. : a successful transfer.  So I figured the obvious thing to do was to
  29. : replace my lrz/lsz logic with C-kermit equivalents.  This worked
  30. : fine but with one problem-- after the transfer finished, C-kermit
  31. : does something that causes a disconnect.  So, I did some research
  32. : on deja/google and found some references to some mention of the
  33. : subject in a documentation file somewhere:
  34. : >Many people want to be able to make a dialout connection with UNIX
  35. : >C-Kermit, but then use some other software on the connection that C-Kermit
  36. : >made.  They quickly find that when they exit from C-Kermit, that the
  37. : >connection is gone before they can start the other application.
  38. : >
  39. : >It is a fundamental property of UNIX that when a process exits, then every
  40. : >file that was opened by that process is automatically closed by UNIX.
  41. : >Closing a terminal device (such as a dialout tty device) hangs it up.
  42. : >There is nothing the process can do about it.
  43. : >
  44. : >However, many workarounds are possible.  Here are just a few:
  45. : >
  46. : > . Read about the REDIRECT command in the ckcker.upd file.
  47. : >
  48. : > . Find out the file descriptor of the open device (it is given by
  49. : >   C-Kermit's \v(ttyfd) variable) and then run ("!") your other program
  50. : >   from the C-Kermit prompt, feeding it the file descriptor, e.g. through
  51. : >   shell redirection or a command line option (the method depends on the
  52. : >   other program, the capabilities of the shell, etc).
  53. : >
  54. : > . After Kermit makes the connection, type "show comm" to find out the
  55. : >   filename of the lock file.  Then suspend Kermit, then delete the lock
  56. : >   file, then start the other program and tell it to open the same tty
  57. : >   device.
  58. : Now my original approach used lrz something like the following:
  59. :     lrz </dev/modem >/dev/modem
  60. : Since this doesn't hang up the line, I presume that the issue is NOT
  61. : "close" of the device.
  62. Right -- it uses the open stdin/stdout file descriptors, which have
  63. been redirected from/to the modem.  Since the lrz program uses stdin/out,
  64. it never opens or closes it.
  65.  
  66. : So I tried serveral things.  I noticed that it is possible to pass in
  67. : an open file descriptor and have kermit use that.  But, I gathered
  68. : you can't just do:
  69. :     kermit -r -i -l 0 </dev/modem
  70. : As this is only open for input, and kermit is going to need bidirectional
  71. : I/O on the FD.
  72. :
  73. Did you try it?
  74.  
  75. : So lastly, I figured ok, let's see if it really is the close of the
  76. : device or something *specific* kermit is doing on exit.  I manually
  77. : invoked kermit so that it wouldn't exit, and instead of doing a "quit"
  78. : after the transfer, I switched to another window and did a kill -9
  79. : on the kermit process.  Voila!  no disconnect occurred.
  80. Because you killed Kermit and it couldn't close the device.  Meanwhile 
  81. another process had it open, right?  That's why you didn't carrier drop
  82. or whatever.
  83.  
  84. : So, I've since implemented a solution to the problem which entails
  85. : a kermit script that does something like this:
  86.  
  87. : set modem none
  88. : set line /dev/modem
  89. : set file type bin
  90. : receive
  91. : !/tmp/killkerm
  92. : And invokes kermit like this:
  93. : echo "kill -9 $$" >/tmp/killkerm
  94. : chmod a+x /tmp/killkerm
  95. : exec kermit -y kermitscript
  96. :
  97. : And it works like a choim.  However, it is a major kludge.
  98. :
  99. Yes indeed.
  100.  
  101. : I'm using
  102. : it because it works, but does anyone know how I can get kermit to NOT
  103. : do whatever it is doing to the device before it exits so I don't have
  104. : use kill?  Perhaps it's doing some kind of rude stty/ioctl that's 
  105. : causing it?
  106. Try the first method (-l 0) and see what happens.  If that doesn't work,
  107. what I'd recommend is to let Kermit handle everything -- dialing, terminal
  108. session, and file transfer.  That's what it's designed for.
  109.  
  110. In any case, let us know what happens and we'll see what to do next.
  111.  
  112. - Frank
  113.